#include "../StdAfx.h"
#include "SevenZipStream.h"

STDMETHODIMP SevenZip::CSevenZipStream::Initialize(const CComPtrBase<IStream> & InnerStream)
{
	_Inner = InnerStream;
	return S_OK;
}

IFACEMETHODIMP SevenZip::CSevenZipStream::Read(PVOID Buffer, UINT32 Count, PUINT32 Read)
{
	return _Inner->Read(Buffer, Count, reinterpret_cast<PULONG>(Read));
}

IFACEMETHODIMP SevenZip::CSevenZipStream::Seek(INT64 Offset, UINT32 Origin, PUINT64 NewPosition)
{
	LARGE_INTEGER OffsetLarge;
	OffsetLarge.QuadPart = Offset;

	return _Inner->Seek(OffsetLarge, Origin, reinterpret_cast<PULARGE_INTEGER>(NewPosition));
}

IFACEMETHODIMP SevenZip::CSevenZipStream::Write(LPCVOID Buffer, UINT32 Count, PUINT32 Written)
{
	return _Inner->Write(Buffer, Count, reinterpret_cast<PULONG>(Written));
}